From f16c6aef6d2aae76eb0750511678de3f1e177461 Mon Sep 17 00:00:00 2001 From: tsteven4 Date: Sun, 24 Jun 2018 17:38:45 -0600 Subject: [PATCH] use c++11 noreturn attribute specifier instead of compiler specific attributes. (#206) This should work for all compilers, and certainly helps out MSVC code analysis. --- defs.h | 4 +--- fatal.cc | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/defs.h b/defs.h index 19ccd301c..de964b2e6 100644 --- a/defs.h +++ b/defs.h @@ -142,10 +142,8 @@ */ #if __GNUC__ # define PRINTFLIKE(x,y) __attribute__ ((__format__ (__printf__, (x), (y)))) -# define NORETURN void __attribute__ ((__noreturn__)) #else # define PRINTFLIKE(x,y) -# define NORETURN void #endif @@ -863,7 +861,7 @@ typedef struct style_vecs { } style_vecs_t; extern style_vecs_t style_list[]; -NORETURN fatal(const char*, ...) PRINTFLIKE(1, 2); +[[noreturn]] void fatal(const char*, ...) PRINTFLIKE(1, 2); void is_fatal(const int condition, const char*, ...) PRINTFLIKE(2, 3); void warning(const char*, ...) PRINTFLIKE(1, 2); void debug_print(int level, const char* fmt, ...) PRINTFLIKE(2,3); diff --git a/fatal.cc b/fatal.cc index 9ae9702ee..11d5ae3b6 100644 --- a/fatal.cc +++ b/fatal.cc @@ -22,7 +22,7 @@ #include "defs.h" #include #include -void +[[noreturn]] void fatal(const char* fmt, ...) { va_list ap; -- 2.30.2